/*
 * @Author: 码农 2646995216@qq.com
 * @Date: 2025-03-07 23:06:59
 * @LastEditors: 码农 2646995216@qq.com
 * @LastEditTime: 2025-03-08 23:05:49
 * @FilePath: /pthread/Threadpool/text.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "threadpool.hpp"
#include "Task.hpp"
#include <ctime>

using namespace std;

int main()
{
    Threadpool<Task> *tp = new Threadpool<Task>;
    tp->Create();
    srand(time(nullptr));
    int len = oper.size();

    while (true)
    {

        int x = rand() % 10 + 1;
        usleep(100);
        int y = rand() % 20 + 1;
        char op = oper[rand() % len];

        Task t(x, y, op);

        tp->push(t);
        sleep(1);
    }
    
    delete tp;

    return 0;
}
